package app_config

import (
	"fmt"
	"github.com/spf13/viper"
)

type AppConfig struct {
	SendSmsConfig
	QiNiuConfig
	GetJwtConfig
}
type SendSmsConfig struct {
	APIID  string
	APIKEY string
}
type QiNiuConfig struct {
	AK string
	SK string
}
type GetJwtConfig struct {
	SecretKey  string
	ExpireTime int64
}

var AppConf AppConfig

func InitApp() {
	viper.SetConfigFile("./app_config/dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		panic(err)
	}
	viper.Unmarshal(&AppConf)
	fmt.Println("viper 动态配置连接成功:", AppConf)
}
